import request from '../utils/request';


/**
 * 产品编辑相关
 */
//图片上传
export const addPicture = (list) => {
    return request({
        url: '/bproduct/addPicture',
        method: 'post',
        data: list
    });
};
//获取产品信息
export const getProductById = (pid) => {
    return request({
        url: '/nproductController/getProductById?pId='+pid,
        method: 'get'
    });
};
//商品更新修改
export const saveOrUpdateProduct = (product) => {
    return request({
        url: '/dateProduct/saveOrUpdateProduct',
        method: 'post',
        data: product
    });
};
//获取货架
export const getShopShelf = () => {
    return request({
        url: '/decoration/getShopShelf',
        method: 'get'
    });
};
//商品上架
export const ontheshelf = (pId) => {
    return request({
        url: '/bproduct/ontheshelf?shopId='+pId,
        method: 'get'
    });
};
//商品下架
export const offtheshelf = (pId) => {
    return request({
        url: '/bproduct/offtheshelf?shopId='+pId,
        method: 'get'
    });
};
//删除商品
export const deleteProduct = (pId) => {
    return request({
        url: '/bproduct/deleteProduct?pId='+pId,
        method: 'get'
    });
};
//获取规格
export const getSpecifications = (pId) => {
    return request({
        url: '/Specifications/getSpecifications?pId='+pId,
        method: 'get'
    });
};
//规格更新修改
export const updateSpecifications = (pId,e) => {
    return request({
        url: '/Specifications/updateSpecifications?pId='+pId,
        method: 'post',
        data: e
    });
};
//设为推荐
export const setRecommended = (pId) => {
    return request({
        url: '/query/setRecommended?pId='+pId,
        method: 'get'
    });
};
//取消推荐
export const cancelRecommended = (pId) => {
    return request({
        url: '/query/cancelRecommended?pId='+pId,
        method: 'get'
    });
};